- In Pipeline Studio, create or open a pipeline and connect the source repository. Add an enabled Git push trigger for the release branch and, if appropriate, a pull request trigger for early SAST checks. Verify event and branch filters.
- Add a Build stage with code checkout, unit tests, and the chosen SAST scanner. Set the SAST threshold according to release policy. A failed Build stage should stop deployment.
- Commit code fixes and rerun the trigger until the SAST gate passes. Keep the scan result tied to the source revision.
WhiteHaX Harness CI CD Integration Help Guide
Developer setup for a Harness pipeline that runs WhiteHaX AI DAST after deployment
This guide takes a developer from a source trigger through SAST, deployment, a WhiteHaX runtime scan, and results review. It assumes an existing Harness project and WhiteHaX account. The companion Python example converts findings to SARIF; its live REST API adapter still requires the endpoint contract used by your WhiteHaX installation.
Repository files and prerequisites
whitehax_scans/whitehax_tests.py whitehax_scans/requirements.txt # if the REST adapter needs packages
Copy Harness-Example-whitehax_test.py from this directory to whitehax_scans/whitehax_tests.py in the repository connected to Harness. Keep the original example until the REST adapter has been implemented and tested.
Configure Harness credentials and target inputs
- In Harness, open the project and create a text secret named WHITEHAX_API_KEY. Limit access to the pipelines that need it. Do not put the key in pipeline YAML, command arguments, or logs.
- Add WHITEHAX_URL as a project or pipeline variable containing the WhiteHaX API base URL. It is distinct from TARGET_URL, which points to the deployed AI application.
- Define TARGET_URL as an explicit runtime input or output from the deployment stage. Use the URL of the running application, including scheme and host. Confirm it resolves and is reachable before scanning.
- For a local or private target, use a runner or network path that reaches the WhiteHaX API, and confirm the WhiteHaX scan engine reaches the application. localhost in a hosted runner refers to that runner.
- Add a Deploy stage after Build. Select the Harness service, environment, and infrastructure definition that match the staging or approved runtime target. Configure the normal rollout and rollback strategy for that environment.
- Add or use a post-deployment health check. Pass the actual deployed application URL into TARGET_URL for the next stage. Do not assume an AWS deployment status event exists in Harness.
- Make the WhiteHaX stage depend on successful deployment and health check. If deployment fails, the WhiteHaX scan must not run against an older endpoint.
Add the WhiteHaX Run step
- Add a post-deploy Build stage with a Python 3.11 image and repository checkout. Add a Run step. Choose infrastructure with network access to the API and target path.
- In the Run step Environment Variables, map WHITEHAX_API_KEY to <+secrets.getValue("WHITEHAX_API_KEY")>, WHITEHAX_URL to its variable, and TARGET_URL to the deployment output or runtime input.
- Set the Run step command and timeout. The command below expects the Python example at the repository path shown in section 1.
A scan adapter failure exits with code 2 and writes no success report. Set the timeout above the real scan polling limit. Avoid echoing credentials or full response bodies in logs.
Implement the WhiteHaX REST adapter
- In fetch_whitehax_findings(), implement authentication, scan submission, bounded polling, failure handling, and finding retrieval using the API contract for your WhiteHaX tenant. Return a list of dictionaries with id, title, description, severity, and uri. Keep stable rule IDs and do not report a failed scan as an empty successful scan. Before enabling live use, test report conversion with an exported findings array:
- Before enabling live use, test report conversion with an exported findings array: